<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
 <link href="assets/css/bootstrap.min.css" rel="stylesheet" />
        <link rel="stylesheet" href="css/style.css"/>       
        <link href="assets/css/codemirror.css" rel="stylesheet">
        <link rel="stylesheet" href="assets/css/ace.min.css" />
        <link rel="stylesheet" href="font/css/font-awesome.min.css" />
        <link rel="stylesheet" href="css/page.css" />
        <!--[if lte IE 8]>
		  <link rel="stylesheet" href="assets/css/ace-ie.min.css" />
		<![endif]-->
		<script src="js/jquery-1.9.1.min.js"></script>
        <script src="assets/js/bootstrap.min.js"></script>
		<script src="assets/js/typeahead-bs2.min.js"></script>           	
		<script src="assets/js/jquery.dataTables.min.js"></script>
		<script src="assets/js/jquery.dataTables.bootstrap.js"></script>
        <script src="assets/layer/layer.js" type="text/javascript" ></script>          
        <script src="js/H-ui.js" type="text/javascript"></script>
        <script src="js/displayPart.js" type="text/javascript"></script>
        <script src="assets/laydate/laydate.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/page/page.js"></script>
<title>系统日志</title>
</head>

<body>
<div class="margin clearfix">
 <div id="system_style">
     <div class="search_style">
     
      <ul class="search_content clearfix">
       <li><label class="l_f">名称</label><input name="" type="text" class="text_add"style=" width:250px"></li>
       <li><label class="l_f">时间</label><input class="inline laydate-icon" id="start" style=" margin-left:10px;"></li>
       <li style="width:90px;"><button type="button" class="btn_search"><i class="fa fa-search"></i>查询</button></li>
      </ul>
    </div>
    <!--系统日志-->
    <div class="system_logs">
       <table class="table table-striped table-bordered table-hover" id="sample-table">
       <thead>
		 <tr>
				<th width="60px">ID</th>
                <th width="60px">登录用户</th>
                <th width="100px">角色</th>
                <th width="150px">操作内容</th>
                <th width="">目标方法</th>
                <th width="">实际参数</th>
				<th width="70">耗时</th>
				<th width="190px">操作时间</th>              
			</tr>
		</thead>
        <tbody>
        <!-- <tr>
         <td>data.id</td>
         <td>data.user</td>
         <td>data.role</td>
         <td>data.operation</td>
         <td>data.method</td>
         <td>data.params</td>
         <td>data.runtime</td>
         <td>data.time</td>
        </tr> -->
        
        </tbody>
        </table>
        <!-- 分页 -->
	       <div class="paging mt30">
				<ul id="page">
					<li>
						<a>上一页</a>
					</li>
					<li>
						<a>首页</a>
					</li>
					<li>
						<a>末页</a>
					</li>
					<li>
						<a class="borderNone">下一页</a>
					</li>
				</ul>
			</div>
    </div>
 </div>
</div>
</body>
</html>
<script>
  laydate({
    elem: '#start',
    event: 'focus' 
});
$(function() {
	getObjects();
	
	
  /* var oTable1 = $('#sample-table').dataTable( {
  "aaSorting":false,//默认第几个排序
  "bStateSave": true,//状态保存
  "aoColumnDefs": [
	//{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
	{"orderable":false}// 制定列不参与排序
  ]}); */	
})
function getObjects(){
	var url = "sysRecord/findRec";
	var params = {"pageSize":pageSize,
			"currentPage":currentPage};
	$.post(url,params,function(result){
		console.log(result);
		if(result.state == 1){
			doHandleResult(result);
			totalPage = result.data.pageCount;
			step();
		}
	});
}
function doHandleResult(result){
	var $tBody = $("tbody");
	$tBody.html("");
	var list = result.data.records;
	for(var i=0;i<list.length;i++){
		var $tr = $("<tr></tr>");
		//获取td
		$tr = getTdObj($tr,list[i]);
		$tBody.append($tr);
	}
};
function getTdObj($tr,data){
	var $td = ""+
    "<td>"+data.id+"</td>"+
    "<td>"+data.user+"</td>"+
    "<td>"+data.role+"</td>"+
    "<td>"+data.operation+"</td>"+
    "<td>"+data.method+"</td>"+
    "<td>"+data.params+"</td>"+
    "<td>"+data.runtime+"</td>"+
    "<td>"+data.time+"</td>";
	$tr.append($td);
	return $tr;
}
</script>
